{extend name="../../common/view/public/base" /}

{block name="title"}账单{/block}

{block name="head"}<script type="text/javascript" src="static/yj.admin.ui/js/jquery/number.js?{:staticCache()}"></script>
<link rel="stylesheet" type="text/css" href="static/library/lay_ui/css/date.css?{:staticCache()}">
<link rel="stylesheet" type="text/css" href="static/admin/css/{:parse_name(request()->controller())}.css?{:staticCache()}">
<script type="text/javascript">
CONFIG['PAGE_SIZE'] = {:config('app.page_size')};
CONFIG['TOTAL'] = {$Total};
CONFIG['LIST'] = window.location;
CONFIG['ADD'] = '{:url("/".parse_name(request()->controller())."/add")}';
CONFIG['ADD_DO'] = '{:url("/".parse_name(request()->controller())."/add",["action"=>"do"])}';
CONFIG['UPDATE'] = '{:url("/".parse_name(request()->controller())."/update")}';
CONFIG['UPDATE_DO'] = '{:url("/".parse_name(request()->controller())."/update",["action"=>"do"])}';
CONFIG['UPDATE2'] = '{:url("/".parse_name(request()->controller())."/update2")}';
CONFIG['DELETE'] = '{:url("/".parse_name(request()->controller())."/delete")}';
CONFIG['DETAIL'] = '{:url("/".parse_name(request()->controller())."/detail")}';
CONFIG['OUTPUT'] = '{:url("/".parse_name(request()->controller())."/output")}';
</script>{/block}

{block name="main"}
<div class="tool advance">
  <div class="row1">
    <h2>账单管理</h2>
  
    <input type="hidden" name="ids">
  
    <div class="button">
      {if condition="isPermission('add')"}<input type="button" value="添加账单" class="button add">{/if}
      {if condition="isPermission('delete')"}<input type="button" value="批量删除" class="button disabled must_select delete" disabled>{/if}
      {if condition="isPermission('output')"}<input type="button" value="导出当前账单" class="button output1">
      <input type="button" value="导出选定账单" class="button disabled must_select output2">{/if}
    </div>

    {if condition="isPermission('update2')"}<p style="float:left;margin:0 0 0 10px;">更新当前收支余，最近：<input type="text" name="rows" value="1000" class="text" style="width:80px;">条 <input type="button" value="确认更新" class="button update2"></p>{/if}
  
    <p class="clear"></p>
  </div>

  {include file="bill/search" /}
</div>

<div class="list">
  {if condition="$Total>0"}
  <table class="{if condition="isPermission('delete')||isPermission('output')"}left-fix{/if}{if condition="isPermission('update')||isPermission('delete')"} right-fix{/if}">
    <thead><tr class="row1">{if condition="isPermission('delete')||isPermission('output')"}<th style="width:60px;"><div class="check-box"><label><input type="checkbox" class="all">全选</label></div></th>{/if}<th style="width:180px;">账单名称</th><th style="width:85px;">所属管理员</th><th style="width:130px;">账单分类</th><th style="width:90px;">收入 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=1&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=1&by=1">↓</a></th><th style="width:90px;">成本/退款 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=2&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=2&by=1">↓</a></th><th style="width:90px;">支出 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=3&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=3&by=1">↓</a></th><th style="width:90px;">退款 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=4&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=4&by=1">↓</a></th><th style="width:160px;">合计 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=5&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=5&by=1">↓</a></th><th style="width:90px;">当前收入 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=6&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=6&by=1">↓</a></th><th style="width:90px;">当前支出 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=7&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=7&by=1">↓</a></th><th style="width:90px;">当前余额 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=8&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=8&by=1">↓</a></th><th style="width:80px;">时间 <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=0&by=0">↑</a> <a href="{:url('/'.parse_name(request()->controller()).'/index')}{$Param}&order=0&by=1">↓</a></th>{if condition="isPermission('detail')||isPermission('update')||isPermission('delete')"}<th style="width:110px;">操作</th>{/if}</tr></thead>
    <tbody class="items"></tbody>
  </table>

  <div class="pagination"><ul></ul></div>
  {else/}
  <p class="nothing"></p>
  {/if}
</div>
{/block}

{block name="right"}
<div class="right">
  <h3>温馨提示 <span class="iconfont icon-fold"></span></h3>
  <ul>
    <li>1、列表中的“账单名称”默认显示20个字符（1个汉字表示2个字符），鼠标悬停在“账单名称”上，将显示全部内容；</li>
    <li>2、点击表头中的上下箭头可进行排序操作；</li>
    <li>3、为了提高性能，当修改或删除账单时，只会更新最近10条账单的“当前收支余”，如果发现“当前收支余”不准确，请通过表格上方的更新按钮进行更新（输入一个大于总账单数的值，可更新所有账单的“当前收支余”）；</li>
    <li>4、如果您只有查看自己账单的权限，列表中的“当前收支余”列可能不连续，属于正常情况。</li>
  </ul>

  <span class="iconfont icon-expand color"></span>
</div>
{/block}